/*
   This file is part of LibMeowC++.

   This is free and unencumbered software released into the public domain.

   Anyone is free to copy, modify, publish, use, compile, sell, or
   distribute this software, either in source code form or as a compiled
   binary, for any purpose, commercial or non-commercial, and by any
   means.

   In jurisdictions that recognize copyright laws, the author or authors
   of this software dedicate any and all copyright interest in the
   software to the public domain. We make this dedication for the benefit
   of the public at large and to the detriment of our heirs and
   successors. We intend this dedication to be an overt act of
   relinquishment in perpetuity of all present and future rights to this
   software under copyright law.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
   OTHER DEALINGS IN THE SOFTWARE.

   For more information, please refer to <http://unlicense.org/>

*/

/*
   File: io.hpp
   Version: 1.0
   Description: Input & Output
*/

/*
   Dependency:
   1.0
   + cstdio
   + string
*/

/*
   TODO:
   Output/Input pointers
   FIXME:
   XXX:
*/

#include <cstdio>
#include <string>

#ifndef _LibMeowCpp_IO_
#define _LibMeowCpp_IO_

namespace meow {
	const char endl = '\n';
	class meow_console_input {
		public:
			meow_console_input operator >>(int& _var) {
				scanf("%d",&_var);
				return *this;
			}
			meow_console_input operator >>(long& _var) {
				scanf("%ld",&_var);
				return *this;
			}
			meow_console_input operator >>(long long& _var) {
				scanf("%lld",&_var);
				return *this;
			}
			meow_console_input operator >>(short& _var) {
				scanf("%hd",&_var);
				return *this;
			}
			meow_console_input operator >>(unsigned int& _var) {
				scanf("%u",&_var);
				return *this;
			}
			meow_console_input operator >>(unsigned long& _var) {
				scanf("%lu",&_var);
				return *this;
			}
			meow_console_input operator >>(unsigned long long& _var) {
				scanf("%llu",&_var);
				return *this;
			}
			meow_console_input operator >>(unsigned short& _var) {
				scanf("%hu",&_var);
				return *this;
			}
			meow_console_input operator >>(char& _var) {
				scanf("%c",&_var);
				return *this;
			}
			meow_console_input operator >>(char*& _var) {
				scanf("%s",_var);
				return *this;
			}
			meow_console_input operator >>(bool& _var) {
				int _tmp;
				scanf("%d",&_tmp);
				_var = _tmp;
				return *this;
			}
			meow_console_input operator >>(float& _var) {
				scanf("%f",&_var);
				return *this;
			}
			meow_console_input operator >>(double& _var) {
				scanf("%lf",&_var);
				return *this;
			}
			meow_console_input operator >>(long double& _var) {
				scanf("%Lf",&_var);
				return *this;
			}
			meow_console_input operator >>(std::string& _var) {
				std::string _tmp;
				char _chr;
				while(1) {
					scanf("%c",&_chr);
					if(_chr != ' ' && _chr != '\t' && _chr != '\0' && _chr != '\n')
						_tmp += _chr;
					else break;
				}
				_var = _tmp;
				return *this;
			}
	};
	class meow_console_output {
		public:
			meow_console_output operator <<(const int _dat) {
				printf("%d",_dat);
				return *this;
			}
			meow_console_output operator <<(const long _dat) {
				printf("%ld",_dat);
				return *this;
			}
			meow_console_output operator <<(const long long _dat) {
				printf("%lld",_dat);
				return *this;
			}
			meow_console_output operator <<(const short _dat) {
				printf("%hd",_dat);
				return *this;
			}
			meow_console_output operator <<(const unsigned int _dat) {
				printf("%u",_dat);
				return *this;
			}
			meow_console_output operator <<(const unsigned long _dat) {
				printf("%lu",_dat);
				return *this;
			}
			meow_console_output operator <<(const unsigned long long _dat) {
				printf("%llu",_dat);
				return *this;
			}
			meow_console_output operator <<(const unsigned short _dat) {
				printf("%hu",_dat);
				return *this;
			}
			meow_console_output operator <<(const char _dat) {
				printf("%c",_dat);
				return *this;
			}
			meow_console_output operator <<(const char* _dat) {
				printf("%s",_dat);
				return *this;
			}
			meow_console_output operator <<(const bool _dat) {
				printf("%d",_dat);
				return *this;
			}
			meow_console_output operator <<(const float _dat) {
				printf("%f",_dat);
				return *this;
			}
			meow_console_output operator <<(const double _dat) {
				printf("%f",_dat);
				return *this;
			}
			meow_console_output operator <<(const long double _dat) {
				printf("%Lf",_dat);
				return *this;
			}
			meow_console_output operator <<(const std::string _dat) {
				printf("%s",_dat.c_str());
				return *this;
			}
	};
	meow_console_input cin;
	meow_console_output cout;
}

#endif // _LibMeowCpp_IO_
